Skip to content

demo pre-commit fixes#1

Open
scottstanie wants to merge 1 commit intoxhuang-jpl:hres_ml_to_plfrom
scottstanie:hres_ml_to_pl_precommit
Open

demo pre-commit fixes#1
scottstanie wants to merge 1 commit intoxhuang-jpl:hres_ml_to_plfrom
scottstanie:hres_ml_to_pl_precommit

Conversation

@scottstanie
Copy link
Copy Markdown

I'm not necessarily opening this to actually merge into your PR, but rather to demo the list of auto-fixes that would be good to address.
I added the python linter settings for pre-commit/ruff from dolphin (which i mostly stole from from Geoff's settings.

Ignore the .precommit and pyproject changes (as in, no need to add to your PR.) They are just added so we get the automatic python linting by Ruff

Also,one that you could safely ignore is the change to the PV_COEFF_A coefficients- but I would want to see some explanation of where those come from/what they are.

I would also guess that if you added types to the variables/functions outputs there might be some mypy errors too, but it skips untyped functions.

Here is the list of ruff errors, most are worth addressing:

ruff.....................................................................Failed
- hook id: ruff
- exit code: 1

src/pyaps3/ecmwfml2pl.py:306:5: D103 Missing docstring in public function
src/pyaps3/ecmwfml2pl.py:320:5: D103 Missing docstring in public function
src/pyaps3/ecmwfml2pl.py:328:89: E501 Line too long (117 > 88)
src/pyaps3/ecmwfml2pl.py:336:5: D205 1 blank line required between summary line and description
src/pyaps3/ecmwfml2pl.py:336:5: D401 First line of docstring should be in imperative mood: "A function to interpolate sounding data from each station to"
src/pyaps3/ecmwfml2pl.py:341:89: E501 Line too long (106 > 88)
src/pyaps3/ecmwfml2pl.py:351:9: E741 Ambiguous variable name: `l`
src/pyaps3/ecmwfml2pl.py:402:5: D103 Missing docstring in public function
src/pyaps3/ecmwfml2pl.py:403:89: E501 Line too long (90 > 88)
src/pyaps3/ecmwfml2pl.py:413:5: D103 Missing docstring in public function
src/pyaps3/ecmwfml2pl.py:443:5: D103 Missing docstring in public function
src/pyaps3/ecmwfml2pl.py:459:5: N802 Function name `ECMWFml2pl` should be lowercase
src/pyaps3/ecmwfml2pl.py:459:5: D417 Missing argument descriptions in the docstring for `ECMWFml2pl`: `input_fname`, `output_fname`, `plevels`
src/pyaps3/ecmwfml2pl.py:471:12: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()`
Found 14 errors.

and just FYI, the first run of pre-commit run --files src/pyaps3/ecmwfml2pl.py produced these, 2/3 of which were auto-fixed (which are the changes in this PR)


Fixed 23 errors:
- src/pyaps3/ecmwfml2pl.py:
    3 × D400 (ends-in-period)
    3 × D300 (triple-single-quotes)
    3 × D415 (ends-in-punctuation)
    2 × W293 (blank-line-with-whitespace)
    2 × D202 (no-blank-line-after-function)
    2 × D413 (blank-line-after-last-section)
    1 × D416 (section-name-ends-in-colon)
    1 × B007 (unused-loop-control-variable)
    1 × RUF005 (collection-literal-concatenation)
    1 × SIM114 (if-with-same-arms)
    1 × D212 (multi-line-summary-first-line)
    1 × E712 (true-false-comparison)
    1 × D407 (dashed-underline-after-section)
    1 × I001 (unsorted-imports)

Found 66 errors (23 fixed, 43 remaining).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant